package com.breakfast.fun.data.entity.user.recharge;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yukai on 16/9/11.
 */
public class RechargeRecord {

    /**
     * total : 12
     * pageTotal : 12
     * data : [{"id":1197,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":100,"rechargeNo":"C760446743438561280","addTime":"2016-08-02 20:06:47","state":1,"payState":2,"payType":"支付宝支付"},{"id":1680,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C768687434140618752","addTime":"2016-08-25 13:52:20","state":1,"payState":2,"payType":"支付宝支付"},{"id":1697,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C768708044426186752","addTime":"2016-08-25 15:14:14","state":1,"payState":2,"payType":"微信支付"},{"id":1822,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C770852608427560960","addTime":"2016-08-31 13:15:58","state":1,"payState":2,"payType":"招行一网通"},{"id":2008,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C773785931453960192","addTime":"2016-09-08 15:31:57","state":1,"payState":2,"payType":"支付宝支付"},{"id":2010,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":100,"rechargeNo":"C773804662007664640","addTime":"2016-09-08 16:46:23","state":1,"payState":2,"payType":"招行一网通"},{"id":2012,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C773821158054301696","addTime":"2016-09-08 17:51:56","state":1,"payState":2,"payType":"微信支付"},{"id":2045,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C773864688973910016","addTime":"2016-09-08 20:44:54","state":1,"payState":2,"payType":"招行一网通"},{"id":2047,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C773869673824522240","addTime":"2016-09-08 21:04:43","state":1,"payState":2,"payType":"招行一网通"},{"id":2062,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C774060147231297536","addTime":"2016-09-09 09:41:35","state":1,"payState":2,"payType":"招行一网通"},{"id":2086,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C774862888761430016","addTime":"2016-09-11 14:51:24","state":1,"payState":2,"payType":"招行一网通"},{"id":2087,"accountId":5407,"accountMobile":"18359928629","cityId":1,"money":1,"rechargeNo":"C774863562400206848","addTime":"2016-09-11 14:54:04","state":1,"payState":2,"payType":"招行一网通"}]
     * msg : 查询成功!!
     * success : true
     */

    private int total;
    private int pageTotal;
    private String msg;
    private boolean success;
    /**
     * id : 1197
     * accountId : 5407
     * accountMobile : 18359928629
     * cityId : 1
     * money : 100.0
     * rechargeNo : C760446743438561280
     * addTime : 2016-08-02 20:06:47
     * state : 1
     * payState : 2
     * payType : 支付宝支付
     */

    private List<RechargeRecordData> data;

    public static RechargeRecord objectFromData(String str) {

        return new Gson().fromJson(str, RechargeRecord.class);
    }

    public static List<RechargeRecord> arrayRechargeRecordFromData(String str) {

        Type listType = new TypeToken<ArrayList<RechargeRecord>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public List<RechargeRecordData> getData() {
        return data;
    }

    public void setData(List<RechargeRecordData> data) {
        this.data = data;
    }

}
